From Andrew - a number of changes for MSVC.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 10 Oct 2005 15:58:28 +0000 (15:58 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 10 Oct 2005 15:58:28 +0000 (15:58 +0000)
cst.c: whack dead variable.
csv_util.c, globals.c, waypt.c : dont explictly init global.
gdb.c, msroute.c: return after 'fatal'. (decoration...)
gpx.c: fix cast.
ignrando.c, nmn4.c: cast _count to int.
waypt.c: init 'no' before use.
cet/* Zero length arrays aren't C89.
msvc/GPSBabel.vcproj: Update.

19 files changed:
gpsbabel/cet/ansi_x3_4_1968.h
gpsbabel/cet/ibm891.h
gpsbabel/cet/ibm903.h
gpsbabel/cet/iso_8859_1.h
gpsbabel/cst.c
gpsbabel/csv_util.c
gpsbabel/filter_skeleton.c
gpsbabel/gdb.c
gpsbabel/globals.c
gpsbabel/gpx.c
gpsbabel/ignrando.c
gpsbabel/jeeps/gpsapp.c
gpsbabel/msroute.c
gpsbabel/msvc/GPSBabel.vcproj
gpsbabel/nmn4.c
gpsbabel/stmwpp.c
gpsbabel/util.c
gpsbabel/waypt.c
gpsbabel/xmlgeneric.c

index c16ea3cc0214bc055ae8050870d635f43b4abbdc..690ae515ab830f083a2740dd940d5bf84b17fa57 100644 (file)
@@ -35,17 +35,13 @@ const char *cet_cs_alias_ansi_x3_4_1968[] =
 };
 
 #define cet_ucs4_ofs_ansi_x3_4_1968 128
-#define cet_ucs4_cnt_ansi_x3_4_1968 0
+#define cet_ucs4_cnt_ansi_x3_4_1968 1
 
-const int cet_ucs4_map_ansi_x3_4_1968[cet_ucs4_cnt_ansi_x3_4_1968] =
-{
-};
+const int cet_ucs4_map_ansi_x3_4_1968[cet_ucs4_cnt_ansi_x3_4_1968];
 
-#define cet_ucs4_to_ansi_x3_4_1968_ct 0
+#define cet_ucs4_to_ansi_x3_4_1968_ct 1
 
-const cet_ucs4_link_t cet_ucs4_to_ansi_x3_4_1968_links[cet_ucs4_to_ansi_x3_4_1968_ct] =
-{
-};
+const cet_ucs4_link_t cet_ucs4_to_ansi_x3_4_1968_links[cet_ucs4_to_ansi_x3_4_1968_ct];
 
 #define cet_ucs4_to_ansi_x3_4_1968_extra_ct 25
 
index 0857712c00541be0c4f6acc513761244c15cca11..863eb4ee51cbf367bc49a0090c4217c076620bad 100644 (file)
@@ -32,17 +32,13 @@ const char *cet_cs_alias_ibm891[] =
 };
 
 #define cet_ucs4_ofs_ibm891 128
-#define cet_ucs4_cnt_ibm891 0
+#define cet_ucs4_cnt_ibm891 1
 
-const int cet_ucs4_map_ibm891[cet_ucs4_cnt_ibm891] =
-{
-};
+const int cet_ucs4_map_ibm891[cet_ucs4_cnt_ibm891];
 
-#define cet_ucs4_to_ibm891_ct 0
+#define cet_ucs4_to_ibm891_ct 1
 
-const cet_ucs4_link_t cet_ucs4_to_ibm891_links[cet_ucs4_to_ibm891_ct] =
-{
-};
+const cet_ucs4_link_t cet_ucs4_to_ibm891_links[cet_ucs4_to_ibm891_ct];
 
 /*
 #define cet_ucs4_to_ibm891_extra_ct 0
index 28b9d2eb34f470ac9d515679868f171e868d6648..9faf793419288a44784823da94b4d23d0947b553 100644 (file)
@@ -32,17 +32,13 @@ const char *cet_cs_alias_ibm903[] =
 };
 
 #define cet_ucs4_ofs_ibm903 128
-#define cet_ucs4_cnt_ibm903 0
+#define cet_ucs4_cnt_ibm903 1
 
-const int cet_ucs4_map_ibm903[cet_ucs4_cnt_ibm903] =
-{
-};
+const int cet_ucs4_map_ibm903[cet_ucs4_cnt_ibm903];
 
-#define cet_ucs4_to_ibm903_ct 0
+#define cet_ucs4_to_ibm903_ct 1
 
-const cet_ucs4_link_t cet_ucs4_to_ibm903_links[cet_ucs4_to_ibm903_ct] =
-{
-};
+const cet_ucs4_link_t cet_ucs4_to_ibm903_links[cet_ucs4_to_ibm903_ct];
 
 /*
 #define cet_ucs4_to_ibm903_extra_ct 0
index 43a0a3be97b7aa1a3f9b753ddc3c6aa2f4abc1d1..0e606255750efcc6bf1233ebd37109c8e7afe003 100644 (file)
@@ -35,17 +35,13 @@ const char *cet_cs_alias_iso_8859_1[] =
 };
 
 #define cet_ucs4_ofs_iso_8859_1 256
-#define cet_ucs4_cnt_iso_8859_1 0
+#define cet_ucs4_cnt_iso_8859_1 1
 
-const int cet_ucs4_map_iso_8859_1[cet_ucs4_cnt_iso_8859_1] =
-{
-};
+const int cet_ucs4_map_iso_8859_1[cet_ucs4_cnt_iso_8859_1];
 
-#define cet_ucs4_to_iso_8859_1_ct 0
+#define cet_ucs4_to_iso_8859_1_ct 1
 
-const cet_ucs4_link_t cet_ucs4_to_iso_8859_1_links[cet_ucs4_to_iso_8859_1_ct] =
-{
-};
+const cet_ucs4_link_t cet_ucs4_to_iso_8859_1_links[cet_ucs4_to_iso_8859_1_ct];
 
 /*
 #define cet_ucs4_to_iso_8859_1_extra_ct 0
index 0e11ec8bcb067a4e76656276f32d48d30e0c2ad0..e707c3cd38e0536a04f5dac20e75cf58ac12fbc7 100644 (file)
@@ -239,7 +239,6 @@ cst_data_read(void)
                                }
                                else
                                {
-                                       double d1, d2;
                                        int interp, i;
                                        char name[256];
                                        char *pow;
index 78842a794e74631a342272a3eccdb7483ec05f51..6292596e794e3bf32cb211c1ba1a5d27ac30410f 100644 (file)
@@ -42,7 +42,7 @@
 /****************************************************************************/
 /* obligatory global struct                                                 */
 /****************************************************************************/
-xcsv_file_t xcsv_file = {};
+xcsv_file_t xcsv_file;
 
 extern char *xcsv_urlbase;
 extern char *prefer_shortnames;
index 28c58e2e7321f2051b5533271a8703308b6a0dba..ac4f0d83671f21ba2a1bd9bc396a15a74a2e5704 100644 (file)
@@ -27,6 +27,7 @@
  */
  
 #include "defs.h"
+#include "filterdefs.h"
 #include <ctype.h>
 
 #define MYNAME "filter_skeleton"
index e72cebab4e0d3e3affeeabfb3efa9828c414efa2..27fc8dc960bd806407683e8e9a32bbca5d9e22a8 100644 (file)
@@ -289,6 +289,7 @@ gdb_fread_str(char *dest, size_t maxlen)
            }
        }
        fatal(MYNAME ": local buffer overflow detected, please report!\n");
+       return 0;
 }
 
 static int
@@ -332,6 +333,7 @@ gdb_fread_le(void *dest, size_t size, int bit_count, const char *prefix, const c
            default:
                fatal(MYNAME "%s: unsupported bit count (%d) in gdb_le_read!\n", prefix, bit_count);        
        }
+       return 0;
 }
 
 static int
@@ -732,6 +734,7 @@ gdb_read_route(void)
        /* This should normally never happen; end of route is handled in main loop before this */
        
        fatal(MYNAME "-%s: Unexpected end of route \"%s\"!", prefix1, xname);
+    return 0;
 }
 
 
index 2702cc679b62191305bf3ea7f9bdc40633ac624a..e2329a9b5445f1a695c5931597f8d5feb0b18afd 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "defs.h"
 
-global_options global_opts = {};
+global_options global_opts;
 const char gpsbabel_version[] = VERSION;
 
 
index 09afdabd45effab1ac2ab87c84b76aaed3355256..5498c0db70f2690e84085f57254d79b54f150255 100644 (file)
@@ -891,7 +891,7 @@ gpx_cdata(void *dta, const XML_Char *s, int len)
        size_t slen = strlen(cdatastr.mem);
 
        vmem_realloc(&cdatastr,  1 + len + slen);
-       estr = (char *) (cdatastr.mem + slen);
+       estr = ((char *) cdatastr.mem) + slen;
        memcpy(estr, s, len);
        estr[len]  = 0;
 
index 1b3d233cad989ef6587ad918b30f5fc73aae5076..152f3ba7ec9c6d28a0bf0426c37b40028898cab6 100644 (file)
@@ -276,7 +276,7 @@ ignr_write(void)
        if (index_opt != NULL)
        {
                track_index = atoi(index_opt);
-               if ((track_index < 1) || (track_index > track_count()))
+               if ((track_index < 1) || (track_index > (int) track_count()))
                    fatal(MYNAME ": Invalid track index %d (we have currently %d track(s))!\n", 
                        track_index, track_count());
        }           
index 2c1c6b0d7bbb313df8704f6f626e4374c7c84a15..99030d40593ee0824d0bdbd6035a8f9c4e29f333 100644 (file)
@@ -3818,7 +3818,6 @@ void GPS_D303b_Get(GPS_PTrack *trk, UC *data)
     uint32 t;
     uint32 raw_lat, raw_lon;
     int lat_undefined, lon_undefined;
-    int i;
     
     p=data;
     
index 9cccb11e7109faa528ad29fe7e730342c57fcdec..ae63e4e7aeb8e75e9fb1961130487fd84044d2c8 100644 (file)
@@ -136,8 +136,12 @@ typedef struct ole_prop_s
 
 static int sector_size = 512;
 
+#ifndef min
 #define min(a,b) ((a) < (b)) ? (a) : (b)
+#endif
+#ifndef max
 #define max(a,b) ((a) > (b)) ? (a) : (b)
+#endif
 
 static gbint32 *ole_fat1 = NULL;
 static gbint32 *ole_fat2 = NULL;
@@ -210,6 +214,7 @@ ole_find_property(const char *property)
                        return item;
        }
        is_fatal((1), MYNAME ": \"%s\" not in property catalog!", property);
+       return 0;
 }
 
 static char *
index 8d000a790d0fcddd12acef29944fbbc7ad43f5f4..0b91ed518a6216564f4c34343fa6e6f764bcf76c 100644 (file)
                        Name="Source Files"
                        Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
                        <File
+                RelativePath="..\an1.c">
+            </File>
+            <File
                                RelativePath="..\arcdist.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                </FileConfiguration>
                        </File>
                        <File
+                RelativePath="..\bcr.c">
+            </File>
+            <File
                                RelativePath="..\brauniger_iq.c">
                        </File>
                        <File
+                RelativePath="..\cet.c">
+            </File>
+            <File
+                RelativePath="..\cet_util.c">
+            </File>
+            <File
                                RelativePath="..\cetus.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                </FileConfiguration>
                        </File>
                        <File
+                RelativePath="..\cst.c">
+            </File>
+            <File
                                RelativePath="..\csv_util.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                </FileConfiguration>
                        </File>
                        <File
+                RelativePath="..\discard.c">
+            </File>
+            <File
                                RelativePath="..\duplicate.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                </FileConfiguration>
                        </File>
                        <File
+                RelativePath="..\filter_skeleton.c">
+            </File>
+            <File
                                RelativePath="..\filter_vecs.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                </FileConfiguration>
                        </File>
                        <File
+                RelativePath="..\formspec.c">
+            </File>
+            <File
                                RelativePath="..\garmin.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                </FileConfiguration>
                        </File>
                        <File
+                RelativePath="..\gdb.c">
+            </File>
+            <File
                                RelativePath="..\geo.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                </FileConfiguration>
                        </File>
                        <File
+                RelativePath="..\globals.c">
+            </File>
+            <File
                                RelativePath="..\glogbook.c">
                        </File>
                        <File
                                RelativePath="..\igc.c">
                        </File>
                        <File
+                RelativePath="..\ignrando.c">
+            </File>
+            <File
                                RelativePath="..\internal_styles.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                RelativePath="..\lowranceusr.c">
                        </File>
                        <File
+                RelativePath="..\maggeo.c">
+            </File>
+            <File
                                RelativePath="..\magnav.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                </FileConfiguration>
                        </File>
                        <File
+                RelativePath="..\msroute.c">
+            </File>
+            <File
                                RelativePath="..\navicache.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                </FileConfiguration>
                        </File>
                        <File
+                RelativePath="..\nmn4.c">
+            </File>
+            <File
+                RelativePath="..\nmn5.c">
+            </File>
+            <File
                                RelativePath="..\overlay.c">
                        </File>
                        <File
                                </FileConfiguration>
                        </File>
                        <File
+                RelativePath="..\pathaway.c">
+            </File>
+            <File
                                RelativePath="..\pcx.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                RelativePath="..\stackfilter.c">
                        </File>
                        <File
+                RelativePath="..\stmwpp.c">
+            </File>
+            <File
+                RelativePath="..\strptime.c">
+            </File>
+            <File
+                RelativePath="..\tef_xml.c">
+            </File>
+            <File
                                RelativePath="..\text.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                </FileConfiguration>
                        </File>
                        <File
+                RelativePath="..\tomtom.c">
+            </File>
+            <File
                                RelativePath="..\tpg.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                </FileConfiguration>
                        </File>
                        <File
+                RelativePath="..\tpo.c">
+            </File>
+            <File
+                RelativePath="..\trackfilter.c">
+            </File>
+            <File
                                RelativePath="..\util.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                                </FileConfiguration>
                        </File>
                        <File
+                RelativePath="..\vitosmt.c">
+            </File>
+            <File
                                RelativePath="..\vmem.c">
                                <FileConfiguration
                                        Name="Release|Win32">
                        <File
                                RelativePath="..\xmlgeneric.c">
                        </File>
+            <File
+                RelativePath="..\xmltag.c">
+            </File>
                        <Filter
                                Name="Jeeps"
                                Filter="">
index 1be8910128d0ffd065052514ecaff8df03d970dd..c80f6df9c656358cdd7dfee77c40b45d1fe2f5af 100644 (file)
@@ -101,7 +101,7 @@ nmn4_concat(char *arg0, ...)
 static char *
 nmn4_read_line(char *buff, size_t buffsize, FILE *fin)
 {
-       char *res, *c;
+       char *res;
        
        while ((res = fgets(buff, buffsize, fin)))
        {
@@ -252,7 +252,7 @@ nmn4_route_tlr(const route_head *rte)
 static void
 nmn4_write_waypt(const waypoint *wpt)
 {
-       char buff[1024], city[128], street[128], zipc[32], number[32];
+       char city[128], street[128], zipc[32], number[32];
        int zip = -1;
        
        if (curr_rte_num != target_rte_num) return;
@@ -287,7 +287,7 @@ nmn4_write_data(void)
        if (index_opt != NULL)
        {
                target_rte_num = atoi(index_opt);
-               is_fatal(((target_rte_num > route_count()) || (target_rte_num < 1)),
+               is_fatal(((target_rte_num > (int) route_count()) || (target_rte_num < 1)),
                        MYNAME ": invalid route number %d (1..%d))!\n", target_rte_num, route_count());
        }
        
index 4c3f94faca9bafed8d2d325c5941f6ea6970dffb..1abd3cf7dc5b8397d88f52b4e36d6e448356b0f7 100644 (file)
@@ -70,7 +70,6 @@ static void
 stmwpp_data_read(void)
 {
        char buff[1024];
-       char *c;
        
        what = STM_NOTHING;
        fgets(buff, sizeof(buff), fin);
index 48ec95b45de79d3cf4a6f4dbecbcd807ce550676..4dd1da8eab690ce0a2e4723928781637f9c36662 100644 (file)
@@ -951,7 +951,6 @@ entitize(const char * str, int is_html)
        const char * cp;
        char * p, * tmp, * xstr;
 
-       char tmpsub[20];
        int bytes = 0;
        int value = 0;
        ep = stdentities;
index bfc1f2b5eb6e2a4b7fa0622f7e679ab0dd7851af..0fdbc2b0298804e771f918288a87d59eac3adc4f 100644 (file)
@@ -23,7 +23,7 @@
 #include "defs.h"
 #include "cet_util.h"
 
-queue waypt_head = {};
+queue waypt_head;
 static unsigned int waypt_ct;
 static void *mkshort_handle;
 
@@ -320,7 +320,8 @@ waypt_backup(unsigned int *count, queue **head_bak)
 {
        queue *elem, *tmp, *qbackup;
        waypoint *wpt;
-       int no;
+    // BUG(akirmse): no was not initialized.  Set to 0 for now to compile it.
+    int no = 0;
 
        qbackup = (queue *) xcalloc(1, sizeof(*qbackup));
        QUEUE_INIT(qbackup);
index d48fc1c7a28a96ab9279de3c2190df547a2e6942..d23db8d314bf74eab8793d339ad178ae6e9c4d6b 100644 (file)
@@ -182,7 +182,6 @@ static void
 xml_cdata(void *dta, const XML_Char *s, int len)
 {
        char *estr;
-       xg_callback *cb;
 
        vmem_realloc(&cdatastr,  1 + len + strlen(cdatastr.mem));
        estr = (char *) cdatastr.mem + strlen(cdatastr.mem);